//
//  SingerCollectionViewCell.m
//  Coco_Music
//
//  Created by K。 on 15/6/22.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SingerCollectionViewCell.h"

@implementation SingerCollectionViewCell
-(void)dealloc
{
    [_singer release];
    [_imageV release];
    [_labelSmallTitle release];
    [super dealloc];
    
}
-(instancetype)initWithFrame:(CGRect)frame
{
    self =  [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
    
}

-(void)createSubView
{

    self.imageV = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = 20;
    self.imageV.layer.borderWidth = 3;
    self.imageV.layer.borderColor = [[UIColor colorWithRed:0.6 green:0.4 blue:0.4 alpha:0.6]CGColor];
    
    [self.contentView addSubview:self.imageV];

    
    self.labelSmallTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.height-5 , 90, 30)];
    self.labelSmallTitle.textAlignment =NSTextAlignmentCenter;
    self.labelSmallTitle.font = [UIFont systemFontOfSize:12.0];
    self.labelSmallTitle.shadowColor = [UIColor colorWithRed:244.0f/255.0f green:147.0f/255.0f blue:23.0f/255.0f alpha:1.0f];
    [self.contentView addSubview:self.labelSmallTitle];
 

}
-(void)setSinger:(Singer *)singer
{
    if (_singer != singer) {
        [_singer release];
         _singer = [singer retain];
    }
    self.labelSmallTitle.text = singer.title;
    NSURL *url =[NSURL URLWithString:singer.pic_url];

    [self.imageV sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"myLogo.png"]];
    
    
    
    
    

    [self.imageV sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];

}
@end
